package blip.jcaf.cm.monitor;

import java.rmi.RemoteException;

import dk.pervasive.jcaf.util.AbstractMonitor;

@SuppressWarnings("serial")
public class Arrival extends AbstractMonitor implements Runnable {
	
	private String myId;
	private final static String _IP = "localhost"; //Change for multiple computers
	private final static String _URI = "rmi://"+_IP+"/blipTest";

	public Arrival(String id) throws RemoteException {
			super(_URI);
			setMyId(id);
	}

	public String getMonitorInfo() {
		return "Arrival monitor";
	}

	public String getMyId() {
		return myId;
	}

	public void setMyId(String myId) {
		this.myId = myId;
	}
	
	public void visitorArrived(String btId) {
		try {
			Runnable bm = new BLIPMonitor(btId);
			Thread thread = new Thread(bm);
			thread.start();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}

	@Override
	public void monitor(String arg0) throws RemoteException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void run() {
		
	}
}
